-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper type annotations (and some refactorings) #18
Conversation
issue_metrics.py
Outdated
# IssueWithMetrics is a type alias for a GitHub issue with metrics attached. | ||
IssueWithMetrics = github3.issues.Issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python is seeing this as a duplicate declaration of IssueWithMetric on line 357. We might just need to move up the class definition to replace these lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, ill push a commit to fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# IssueWithMetrics is a type alias for a GitHub issue with metrics attached. | |
IssueWithMetrics = github3.issues.Issue | |
from github3.issues.issue import Issue as IssueWithMetrics |
Does this look good? I am directly renaming the github3.Issue type in the import statement itslf
I think this will fix the issue that python is complaining about...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's accurate to say that IssueWithMetrics
is of type github3.issues.issue. I've moved the definition of issueWithMetrics
earlier in the file so it can be referenced earlier. That seems to have resolved the issue.
Sourcery AI refactored this branch
Update: Sourcery AI provided some refactorings, ive included them, for the code explainations see Advik-B#1 |
Signed-off-by: Zack Koppert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This pull request adds type annotations and updates function docstrings.